#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <string>
using namespace std;

int main() {
    string s;
    while (cin >> s)
    {
        int i = -1;
        int n = 1;
        int sum = 0;
        while (n < 10)
        {
            ++i;
            if (s[i] == '-')
                continue;

            sum += (s[i] - '0') * n++;
        }
        int x = sum % 11;
        if (x == 10)
        {
            if (s[s.size() - 1] == 'X')
                cout << "Right" << endl;
            else
            {
                s[s.size() - 1] = 'X';
                cout << s << endl;
            }
        }
        else {
            if (s[s.size() - 1] == x + '0')
                cout << "Right" << endl;
            else
            {
                s[s.size() - 1] = x + '0';
                cout << s << endl;
            }
        }
    }
    return 0;
}